package com.my.test.design.decorate;

/**
 * 继承是关键1
 */
public abstract class Decorate implements Component {

    /**
     * 关键2
     */
    private Component component;

    public Decorate(Component component) {
       this.component = component;
    }


    @Override
    public void operate() {
        /**
         * 实际执行的是被修饰的类DecorateC、DecorateB、DecorateC、component
         */
        component.operate();
    }


}
